package com.dong.order.web.controller;

import com.dong.common.core.ResultData;
import com.dong.order.client.LightPolicyClient;
import com.dong.policy.entity.mysql.policy.Policy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class FooController {

    private final LightPolicyClient policyClient ;

    public FooController(LightPolicyClient policyClient) {
        this.policyClient = policyClient;
    }

    @GetMapping("/{id}")
    public ResultData<Policy> hello(@PathVariable("id") Long id) {
        return policyClient.findPolicy(id);
    }
}
